<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="style.css" />
	<link rel="stylesheet" href="../resources/debug.css" />
	<script src="../lib/angular.min.js"></script>
	<script src="../lib/ocDraggable/draggable.js"></script>
	<script src="../dist/ocDialog.min.js"></script>
	<!--<script src="../src/s-dialog.js"></script>-->
	<!--<script src="../src/dialog.js"></script>-->
	<!--<script src="../src/d-dialog.js"></script>-->
	<!--<script src="../src/d-dialog-open.js"></script>-->
	<!--<script src="../src/d-dialog-close.js"></script>-->
	<!--<script src="../src/d-alert.js"></script>-->
	<script>
	var app = angular.module("test", ['oc-dialog', 'oc-draggable']);
		app.config(function (ocDialogProvider) {
			ocDialogProvider.config("ROUTE_PATH", "./dialog/");
			ocDialogProvider.config("BASE_Z_INDEX", 500);
		});
		app.controller('E', function ($scope, ocDialog) {
			$scope.title2 = "test2";
			$scope.now = Date.now();

			$scope.a = function () {
				console.log($scope.now);
			};

			$scope.dd = function () {
				console.log("大爷来嘛~~~");
			};

			$scope.cc = function (data) {
				console.log(data);
			};

			$scope.hh = "妞，给爷笑一个";
			$scope.ii = function () {
				console.log("去你妈的傻逼");
			}


//			ocDialog.getDialog("test").then(function (dialog) {
//				dialog.opening(function () {
//					console.log("What time is it?");
//					return $scope.now;
//				}).closed(function (say) {
//					console.log("He said: \"" + say + '".');
//				});
//			});
		});
		app.controller("A", function ($scope, ocDialog) {
			$scope.fuck = "shit a title";

			$scope.daf = function () {
				return $scope.fuck;
			};

			ocDialog.getDialog("test").then(function (dialog) {
				dialog.opened(function (time) {
					console.log("It's " + time);
				});
			});
		});
	</script>
</head>
<body ng-app="test" ng-controller="E">
{{title2}}
	<a oc-dialog-open="test">fsfafas</a>
	<a oc-dialog-open="{test: now}">fsfafas2</a>
	<a oc-dialog-open="{test: {transOpen: a, fetchClose: cc}, test2: title2}">fsfafas2</a>
	<a oc-dialog-open="test3">第三个窗口</a>
	<a oc-dialog-close="test">关闭窗口test</a>
	<a oc-alert="{msg:hh, ok:ii,cancel:a}">笑一个</a>
	<a oc-alert="{msg:now, callback:dd}">笑两个</a>
</body>
</html>
